#include "timer_loop.h"
extern TIM_HandleTypeDef htim3;
uint16_t g_time_10ms_fg;
void timer_start(void)
{
    __HAL_TIM_CLEAR_IT(&htim3, TIM_IT_UPDATE); // 清除IT标志位
    HAL_TIM_Base_Start_IT(&htim3);             // 启动时基
}

void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *hitm)
{
    static uint16_t count1;
    if (hitm->Instance == TIM3) // 定时时间10ms
    {
        count1++;
        if (count1 == 10)
        {
            count1 = 0;
            g_time_10ms_fg = 1;
        }
    }
}
